package com.lskj.shiro.vo;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author zzq
 * @Date 2020/4/3 12:33
 * @Version 1.0
 */
//@Setter
//@ToString
@Data
public class ResultVO<T> implements Serializable {
    private static final long serialVersionUID = -611707688185723193L;
    private Integer code;
    private Boolean success;
    private String message;
    private T data;

    public ResultVO() {
        this.code = 200;
        this.success = true;
    }

    public static ResultVO ok(){
        return new ResultVO();
    }

    public static ResultVO error500(String message){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(500);
        resultVO.setSuccess(false);
        resultVO.setMessage(message);
        return resultVO;
    }
}
